home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-04-10 | 1.6 KB | 34 lines | [ttro/ttxt] |
- Circular Layout Notes
-
- This sample does not use the "standard" QuickDraw GX shell, but uses a
- hacked-up version of it. We do this because the standard shell is based around
- the idea that all windows are basically pictures, and in this sample the window
- contains moving shapes. If we tried to keep things as a single picture, we'd
- be calling GXGetPictureParts and GXSetPictureParts all the time, and this would
- not be good for performance.
-
- So the shell is hacked to track two oval shapes for every document. The first oval is
- the shape we draw. It looks like curved layouts because the oval is drawn with
- a dash shape created from a layout shape. This, in my own opinion, is really
- cool.
-
- The second shape is a copy of that oval, but colored white -- drawing this oval
- on top of the other one effectively erases the first. We calculate it every
- time we need it, but we keep a copy with the document so we're not constantly
- creating and disposing of shapes.
-
- Each time there's no event to process, we call the DoIdle routine. It calls
- the draw routine, which changes the oval slightly and redraws it. As it
- changes and creates the shapes to draw, it caches them with GXCacheShape so
- that when they draw, they'll draw as fast as possible. If you don't believe
- this matters, try commenting out the GXCacheShape calls for the ovals and
- watching the difference.
-
- To print, though, we make a picture shape and use the shell's existing picture
- printing code. This seemed easier than rewriting even more code.
-
- Yes, this sample supports multiple windows as well, but only the front window
- shows any action.
-
- QuickDraw™ GX Developer Support Center
-